package responses

import (
	"github.com/edgexfoundry/edgex-go/internal/app/dtos"
	"github.com/edgexfoundry/go-mod-core-contracts/v2/dtos/common"
)

type ProductResponse struct {
	common.BaseResponse `json:",inline"`
	Product             dtos.Product `json:"product"`
}

func NewProductResponse(requestId string, message string, statusCode int, product dtos.Product) ProductResponse {
	return ProductResponse{
		BaseResponse: common.NewBaseResponse(requestId, message, statusCode),
		Product:      product,
	}
}

type MultiProductsResponse struct {
	common.BaseWithTotalCountResponse `json:",inline"`
	Products                          []dtos.Product `json:"products"`
}

func NewMultiProductsResponse(requestId string, message string, statusCode int, totalCount uint32, products []dtos.Product) MultiProductsResponse {
	return MultiProductsResponse{
		BaseWithTotalCountResponse: common.NewBaseWithTotalCountResponse(requestId, message, statusCode, totalCount),
		Products:                   products,
	}
}
